<template>
  <van-popup
    v-model="mypopup"
    closeable
    close-icon="close"
    position="bottom"
    :style="{ height: '30%' }"
    @closed="myclose"
  >
    <div class="goodsInfo">
      <van-row class="">
        <van-col span="8">
          <img style="width: 100%" :src="tempinfo.list_pic_url" alt="" />
        </van-col>
        <van-col span="16" class="h_content">
          <h2>
            价格:<span>{{ tempinfo.retail_price | RMB }}</span>
          </h2>
          <h2>
            库存:<span>{{ tempinfo.goods_number }}</span>
          </h2>
        </van-col>
        <van-col span="4"> 数量: </van-col>
        <van-col span="20">
          <van-stepper v-model="number" input-width="40px" button-size="32px" />
        </van-col>
      </van-row>
    </div>
  </van-popup>
</template>

<script>
export default {
  props: {
    popushow: {
      type: Boolean,
      dafault: false,
    },
    tempinfo: {
      type: Object,
    },
    addnumber:{
        type:Number,
        default:1
    }
  },
  watch: {
    popushow: {
      handler(newval) {
        this.mypopup = newval;
      },
      immediate: true,
    },
    number(newval){
        this.$emit("addnumber",newval)
    }
  },
  data() {
    return {
      number: 1,
      mypopup: false,
    };
  },
  methods: {
    myclose() {
      this.$emit("update:popushow", false);
    },
  },
};
</script>

//
<style lang="less" scoped>
.van-col {
  height: 130px;
  line-height: 50px;
  text-align: left;
  font-size: 16px;
}
</style>
